<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title></title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/template/pc1/images/wmh_favicon.ico">
    <link href="/res/plugins/hplus/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/res/plugins/hplus/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/res/plugins/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/res/plugins/hplus/css/animate.css" rel="stylesheet">
    <link href="/res/plugins/hplus/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/res/css/common.css" rel="stylesheet" type="text/css" />

</head>

<body class="white-bg">
<div class="path">
    订单管理 &raquo; 订单发货
</div>

<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12" >
            <div class="alert alert-warning alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                可以对订单进行搜索和处理，方便的对已有订单进行处理.
            </div>
            <!--<div class="col-sm-12" style="margin-bottom: 10px" id="toolbar">
                <div class="form-inline" role="form">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <span>订单编号: </span>
                            <input name="orderSn" class="form-control w200">
                        </div>
                        <div class="form-group">
                            <span>收货人: </span>
                            <input name="shipName" class="form-control w70">
                        </div>
                        <div class="form-group">
                            <span>付款状态:</span>
                            <select class="form-control w70" name="paymentStatus">
                                <option value="">请选择</option><option value="0">未支付</option><option value="1">部分支付</option><option value="2">已支付</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-sm-12 float-e-margins" style="margin-top: 10px">
                        <div class="form-group">
                            <span>支付方式:</span>
                            <select class="form-control w70" name="paymentConfigName">
                                <option value="">请选择</option><option value="微信">微信</option><option value="积分">积分</option><option value="预存款">预存款</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <span>配送方式:</span>
                            <select class="form-control w70" name="deliveryTypeName">
                                <option value="">请选择</option><option value="顺丰">顺丰</option><option value="自提">自提</option><option value="预存款">预存款</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <span>下单时间：</span>
                            <input placeholder="开始日期" class="form-control layer-date" name="startCreateDate" id="start">
                            <input placeholder="结束日期" class="form-control layer-date" name="endCreateDate" id="end">
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-8">
                                <button id="ok" type="submit" class="btn btn-sm btn-primary pull-right m-t-n-xs">搜索</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>-->
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="false">待发货</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">待收货</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">已收货</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <!--代发货-->
                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body">
                            <table id="dfhTableEvents" data-toggle="table" data-mobile-responsive="true">
                                <thead>
                                <tr>
                                    <th data-field="orderSn">订单编号</th>
                                    <th data-field="trade_no">微信流水号</th>
                                    <th data-field="username">昵称</th>
                                    <th data-field="shipName">姓名</th>
                                    <th data-field="code">会员ID</th>
                                    <th data-field="totalAmount">订单总额</th>
                                    <th data-field="paymentStatus" data-formatter="paymentStatusF">付款状态</th>
                                    <th data-field="shippingStatus" data-formatter="shippingStatusF">配送状态</th>
                                    <th data-field="paymentConfigName">支付方式</th>
                                    <th data-field="deliveryTypeName">配送方式</th>
                                    <th data-field="createDate">下单时间</th>
                                    <th data-field="head" data-formatter="headFormatter">操作</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                    <!--待收货-->
                    <div id="tab-2" class="tab-pane">
                        <div class="panel-body">
                            <table id="dshTableEvents" data-toggle="table" data-mobile-responsive="true">
                                <thead>
                                <tr>
                                    <th data-field="orderSn">订单编号</th>
                                    <th data-field="trade_no">微信流水号</th>
                                    <th data-field="shipName">用户名</th>
                                    <th data-field="code">会员ID</th>
                                    <th data-field="totalAmount">订单总额</th>
                                    <th data-field="paymentStatus" data-formatter="paymentStatusF">付款状态</th>
                                    <th data-field="shippingStatus" data-formatter="shippingStatusF">配送状态</th>
                                    <th data-field="paymentConfigName">支付方式</th>
                                    <th data-field="deliveryTypeName">配送方式</th>
                                    <th data-field="createDate">下单时间</th>
                                    <th data-field="head" data-formatter="headFormatter">操作</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                    <!--已收货-->
                    <div id="tab-3" class="tab-pane">
                        <div class="panel-body">
                            <table id="yshTableEvents" data-toggle="table" data-mobile-responsive="true">
                                <thead>
                                <tr>
                                    <th data-field="orderSn">订单编号</th>
                                    <th data-field="trade_no">微信流水号</th>
                                    <th data-field="shipName">用户名</th>
                                    <th data-field="code">会员ID</th>
                                    <th data-field="totalAmount">订单总额</th>
                                    <th data-field="paymentStatus" data-formatter="paymentStatusF">付款状态</th>
                                    <th data-field="shippingStatus" data-formatter="shippingStatusF">配送状态</th>
                                    <th data-field="paymentConfigName">支付方式</th>
                                    <th data-field="deliveryTypeName">配送方式</th>
                                    <th data-field="createDate">下单时间</th>
                                    <th data-field="head" data-formatter="headFormatter">操作</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/res/plugins/hplus/js/jquery.min.js?v=2.1.4"></script>
<script src="/res/plugins/hplus/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/res/plugins/hplus/js/content.js?v=1.0.0"></script>
<script src="/res/plugins/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/res/plugins/hplus/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/res/plugins/hplus/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="https://static.9hive.cn/global/vendor/layer/layer.js"></script>
<script src="/res/plugins/hplus/js/plugins/toastr/toastr.min.js"></script>
<!--<script src="/res/plugins/hplus/js/plugins/layer/laydate/laydate.js"></script>-->
<script>
    //var start={elem:"#start",format:"YYYY/MM/DD hh:mm:ss",min:laydate.now(),max:"2099-06-16 23:59:59",istime:true,istoday:false,choose:function(datas){end.min=datas;end.start=datas}};var end={elem:"#end",format:"YYYY/MM/DD hh:mm:ss",min:laydate.now(),max:"2099-06-16 23:59:59",istime:true,istoday:false,choose:function(datas){start.max=datas}};laydate(start);laydate(end);
    //支付状态:0-未支付,1-部分支付,2-已支付,3-部分退款,4-全额退款
    function paymentStatusF(v) {
        if(v == 0){
            return "未支付";
        }else if(v == 1){
            return "部分支付";
        }else if(v == 2){
            return "已支付";
        }else if(v == 3){
            return "部分退款";
        }else if(v == 4){
            return "全额退款";
        }
    }
    //物流状态:0-未发货,1-部分发货,2-已发货,3-部分退货,4-已退货
    function shippingStatusF(v) {
        if(v == 0){
            return "未发货";
        }else if(v == 1){
            return "部分发货";
        }else if(v == 2){
            return "已发货";
        }else if(v == 3){
            return "部分退货";
        }else if(v == 4){
            return "已退货";
        }
    }

    function headFormatter(value, row, index){

        var html = '<a class="am-text-secondary" href="/shop/orderManage/view?orders.id='+row.id+'" title="查看">[查 看]</a>';
        if ((row.orderStatus != 2) && (row.orderStatus != 3) && (row.paymentStatus == 0) && (row.shippingStatus == 0)){
            html += '<a class="am-text-secondary" href="/order/edit?orders.id='+row.id+'" title="编辑">[编 辑]</a>';
        }
        html += '<a class="am-text-secondary" href="/shop/orderManage/process?orders.id='+row.id+'&type=wl" title="处理">[处 理]</a>';

        return html;
    }

    function stateFormatter(value){
        if(value){
            return "锁定";
        }else{
            return "正常";
        }
    }

    function queryParams() {
        var params = {};
        $('#toolbar').find('input[name]').each(function () {
            params[$(this).attr('name')] = $(this).val();
        });
        $('#toolbar').find('select').each(function () {
            params[$(this).attr('name')] = $(this).val();
        });
        return params;
    }

    var $dfhtable = $('#dfhTableEvents'),$dshtable = $('#dshTableEvents'),$yshtable = $('#yshTableEvents'),
        $ok = $('#ok');

    $(function () {
        $ok.click(function () {
            $dfhtable.bootstrapTable('refresh');
            $dshtable.bootstrapTable('refresh');
            $yshtable.bootstrapTable('refresh');
        });
    });

    (function() {
        $('#dfhTableEvents').bootstrapTable({
            url: "ajaxlist?status=dfh",
            search: true,
            pagination: true,
            showRefresh: true,
            showToggle: true,
            showColumns: true,
            iconSize: 'outline',
//            toolbar: '#toolbar',
            queryParams: 'queryParams',
            icons: {
                refresh: 'glyphicon-repeat',
                toggle: 'glyphicon-list-alt',
                columns: 'glyphicon-list'
            }
        });
        $('#dshTableEvents').bootstrapTable({
            url: "ajaxlist?status=dsh",
            search: true,
            pagination: true,
            showRefresh: true,
            showToggle: true,
            showColumns: true,
//            toolbar: '#toolbar',
            iconSize: 'outline',
//            toolbar: '#exampleTableEventsToolbar',
            queryParams: 'queryParams',
            icons: {
                refresh: 'glyphicon-repeat',
                toggle: 'glyphicon-list-alt',
                columns: 'glyphicon-list'
            }
        });
        $('#yshTableEvents').bootstrapTable({
            url: "ajaxlist?status=ysh",
            search: true,
            pagination: true,
            showRefresh: true,
            showToggle: true,
            showColumns: true,
//            toolbar: '#toolbar',
            iconSize: 'outline',
//            toolbar: '#exampleTableEventsToolbar',
            queryParams: 'queryParams',
            icons: {
                refresh: 'glyphicon-repeat',
                toggle: 'glyphicon-list-alt',
                columns: 'glyphicon-list'
            }
        });
    })();
</script>
</body>

</html>
